package emulator.hardware.io.peripherals.iec.sim;

public class Edge
{
	private Event	_event;
	private Action	_action;
	private MachineState	_nextState;

	public Edge(Event event, Action action, MachineState nextState)
	{
		_event = event;
		_action = action;
		_nextState = nextState;
	}
	
	public boolean isActive()
	{
		return _event.evaluate();
	}
	
	public MachineState execute()
	{
		_action.execute();
		return _nextState.enter();
	}
}
